package cn.xiehangs;


import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.utils.ScreenUtils;

public class 飞行棋 extends Game {
	Batch batch;
	private Screen screen=null;
	private Button button;
	Button.ButtonStyle style1;
	Texture imageUp,imageDown,imageOver;
	Stage stage1;
	String name="start";//用于判断当前是哪个界面
	cn.xiehangs.start_飞行棋 start;
	game_2_联网_还没写 game_2;
	cn.xiehangs.game_main game_main;
	cn.xiehangs.choose_飞行棋 choose;
	Setting_还没写 Setting;
	int stageWidth = 1024+1024/3;
	int stageHeight = 1024;
	@Override
	public void create() {
		start=new start_飞行棋(this);
		game_main=new game_main(this);
		game_2=new game_2_联网_还没写();
		Setting=new Setting_还没写();
		choose=new choose_飞行棋(this);
		setScreen(start);
	}
	public void panduan() {
		if (this.name .equals( "start")) {
			if (start.next.equals("choose")) {
				setScreen(choose);
				name=choose.name;
			}
			if (start.next.equals("game_2")) {
				setScreen(game_2);
				name=game_2.name;
			}
			if (start.next.equals("Setting")) {
				setScreen(Setting);
				name=Setting.name;
			}
			if (start.next.equals("Exit")) {
				Gdx.app.exit();
			}
			start.next="";
		}
		if (this.name.equals("game_2")) {
			if (game_2.next.equals("start")) {
				setScreen(start);
				name=start.name;
			}
			if (game_2.next.equals("Exit")) {
				Gdx.app.exit();
			}
			game_2.next="";
		}
//		if (this.name.equals("Setting")) {
//			if (Setting.next.equals("start")) {
//				setScreen(start);
//				name=start.name;
//			}
////			Setting.next="";
//		}
		if (this.name.equals("choose")) {
			if (choose.next.equals("game_main")) {
				setScreen(game_main);
				game_main.setRobot(choose.is_robot_1,choose.is_robot_2,choose.is_robot_3,choose.is_robot_4);
				name=game_main.name;
			}
			choose.next="";
		}
		if (this.name.equals("game_main")) {
			if (game_main.next.equals("choose")) {
				setScreen(choose);
				name=choose.name;
				game_main.chu_shi_hua();
			}
			if (game_main.next.equals("Exit")) {
				Gdx.app.exit();
			}
			if (game_main.next.equals("start")) {
				setScreen(start);
				name=start.name;
				game_main.chu_shi_hua();
			}
			game_main.next="";
		}
	}
}
